//初始化数据
function tabbarinit() {
  return [
    {
      "current": 0,
      "pagePath": "/pages/serverPages/index/index",
      "iconPath": "/assets/img/appoint.png",
      "selectedIconPath": "/assets/img/appointSelected.png",
      "text": "订座表单"
    },
    {
      "current": 0,
      "pagePath": "/pages/serverPages/order/order",
      "iconPath": "/assets/img/order.png",
      "selectedIconPath": "/assets/img/orderSelected.png",
      "text": "订单列表"
    },
    {
      "current": 0,
      "pagePath": "/pages/serverPages/my/my",
      "iconPath": "/assets/img/my.png",
      "selectedIconPath": "/assets/img/mySelected.png",
      "text": "个人中心"
    },
  ]

}
//tabbar 主入口
function tabbarmain(bindName = "tabdata", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = tabbarinit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

module.exports = {
  tabbar: tabbarmain
}
